package com.baida.retail.tasksystem.service.impl;

import com.baida.retail.tasksystem.dao.UserDao;
import com.baida.retail.tasksystem.entity.User;
import com.baida.retail.tasksystem.enums.ErrorCode;
import com.baida.retail.tasksystem.message.logic.Result;
import com.baida.retail.tasksystem.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class UserServiceImpl implements UserService {
    @Autowired
    UserDao userDao;

    @Override
    public Result getUsers() {
        List<User> all = userDao.getAll();
        return new Result(ErrorCode.SUCCESS, all);
    }
}
